package com.cykj.pos.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.cykj.pos.mapper.BizAdvertisingTypeMapper;
import com.cykj.pos.domain.BizAdvertisingType;
import com.cykj.pos.service.IBizAdvertisingTypeService;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 广告类型Service业务层处理
 *
 * @author weijianbo
 * @date 2021-04-27
 */
@Service
public class BizAdvertisingTypeServiceImpl extends ServiceImpl<BizAdvertisingTypeMapper, BizAdvertisingType> implements IBizAdvertisingTypeService {

    @Resource
    private BizAdvertisingTypeMapper bizAdvertisingTypeMapper;
    @Override
    public List<BizAdvertisingType> queryList(BizAdvertisingType bizAdvertisingType) {
        LambdaQueryWrapper<BizAdvertisingType> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(bizAdvertisingType.getAdvertisingType())){
            lqw.eq(BizAdvertisingType::getAdvertisingType ,bizAdvertisingType.getAdvertisingType());
        }
        if (StringUtils.isNotBlank(bizAdvertisingType.getAdvertisingDescribe())){
            lqw.eq(BizAdvertisingType::getAdvertisingDescribe ,bizAdvertisingType.getAdvertisingDescribe());
        }
        return this.list(lqw);
    }

    @Override
    public List<BizAdvertisingType> selectAllAdvertisingType() {
        return bizAdvertisingTypeMapper.selectAllAdvertisingType();
    }
}
